// 视图组件
const view = {
  tabs: () => import("@/layouts/tabs"),
  blank: () => import("@/layouts/BlankView"),
  page: () => import("@/layouts/PageView"),
  user: () => import("@/layouts/UserLayout")
};
const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}
/**
 *
 * @type {{exception: {component: (function(): Promise<*>), name: string, icon: string}, components: {component: (function(): Promise<*>), name: string, icon: string}, searchList: {path: string, component: (function(): Promise<*>), name: string}, primaryList: {path: string, component: (function(): Promise<*>), name: string}, project: {component: (function(): Promise<*>), name: string}, login: {path: string, component: (function(): Promise<*>), authority: string}, error: {component: (function(): Promise<*>), name: string}, queryList: {path: string, component: (function(): Promise<*>), name: string}, advanceDetails: {path: string, component: (function(): Promise<*>), name: string}, result: {component: (function(): Promise<*>), name: string, icon: string}, exp500: {path: string, component: (function(): Promise<*>), name: string}, exp403: {path: string, component: (function(): Promise<*>), authority: string, name: string}, exp404: {path: string, component: (function(): Promise<*>), name: string}, root: {redirect: string, path: string, component: (function(): Promise<*>), name: string}, details: {component: (function(): Promise<*>), name: string, icon: string}, palette: {component: (function(): Promise<*>), name: string}, dashboard: {component: (function(): Promise<*>), name: string}, basicForm: {path: string, component: (function(): Promise<*>), name: string}, advanceForm: {path: string, component: (function(): Promise<*>), name: string}, basicDetails: {path: string, component: (function(): Promise<*>), name: string}, analysis: {component: (function(): Promise<*>), name: string}, list: {component: (function(): Promise<*>), name: string, icon: string}, article: {component: (function(): Promise<*>), name: string}, stepForm: {path: string, component: (function(): Promise<*>), name: string}, cardList: {path: string, component: (function(): Promise<*>), name: string}, taskCard: {component: (function(): Promise<*>), name: string}, form: {component: (function(): Promise<*>), name: string, icon: string}, application: {component: (function(): Promise<*>), name: string}, success: {component: (function(): Promise<*>), name: string}, workplace: {component: (function(): Promise<*>), name: string}}}
 * registerName: {                               //路由组件注册名称，唯一标识
 path: 'path',                               //路由path，可缺省，默认取路由注册名称 registerName 的值
 name: '演示页',                             //路由名称
 redirect: '/login',                         //路由重定向
 component: () => import('@/pages/demo'),    //路由视图
 icon: 'permission',                         //路由的菜单icon，会注入到路由元数据meta中
 invisible: false,                           //是否隐藏菜单项，true 隐藏，false 不隐藏，会注入到路由元数据meta中。
 authority: 'admin',                               //路由权限配置，会注入到路由元数据meta中。可缺省，默认为 []
 page: {                                     //路由的页面数据，会注入到路由元数据meta中
 title: '演示页',                          //页面标题
 breadcrumb: ['首页', '演示页']            //页面面包屑
 }
 }
 */
// 路由组件注册
const routerMap = {
  login: {
    authority: "*",
    path: "/login",
    name: "登录页",
    component: () => import("@/pages/login")
  },
  auth: {
    authority: "*",
    path: "/auth",
    name: "用户授权",
    component: () => import("@/pages/login/Auth")
  },
  home: {
    path: "/",
    name: "首页",
    redirect: "/login",
    component: view.tabs,
    children: [
    ]
  },
  dashboard: {
    name: "工作台",
    path: "/workplace",
    icon: "dashboard",
    invisible: false,
    page: {
      closable: false
    },
    component: () => import("@/pages/dashboard/workplace/WorkPlace")
  },
  exp403: {
    authority: "*",
    name: "exp403",
    path: "403",
    component: () => import("@/pages/exception/403")
  },
  exp404: {
    name: "exp404",
    path: "404",
    component: () => import("@/pages/exception/404")
  },
  exp500: {
    name: "exp500",
    path: "500",
    component: () => import("@/pages/exception/500")
  },
  // 设备管理
  deviceManagement:{
    path: '/deviceManagement',
    name: 'deviceManagement',
    component: view.blank,
    meta: { title: 'menu.deviceManagement', icon: 'table', permission: ['form'] },
  },
  // 台账
  ledger: {
    path: '/deviceManagement/ledger',
    name: 'ledger',
    icon: "schedule",
    component: () => import('@/pages/deviceManagement/ledger'),
    meta: { title: 'menu.deviceManagement.ledger', keepAlive: true, permission: ['form'] }
  },
  // 备品备件模块-add
  sparePartsModule:{
    path: '/deviceManagement/sparePartsModule',
    name: 'sparePartsModule',
    component: view.blank,
    meta: { title: 'menu.deviceManagement.sparePartsModule', icon:'schedule', keepAlive: true, permission: ['form'] },
  },
  // 备品备件-改
  spareParts: {
    path: '/deviceManagement/sparePartsModule/spareParts',
    name: 'spareParts',
    component: () => import('@/pages/deviceManagement/spareParts'),
    meta: { title: 'menu.deviceManagement.sparePartsModule.spareParts', keepAlive: true, permission: ['form'] }
  },
  //备品申请-add
  sparePartsRequest:{
    path: '/deviceManagement/sparePartsModule/sparePartsRequest',
    name: 'sparePartsRequest',
    component: () => import('@/pages/deviceManagement/sparePartsRequest'),
    meta: { title: 'menu.deviceManagement.sparePartsModule.sparePartsRequest', keepAlive: true, permission: ['form'] }
  },
  //备品入库-add
  sparePartsWarehousing:{
    path: '/deviceManagement/sparePartsModule/sparePartsWarehousing',
    name: 'sparePartsWarehousing',
    component: () => import('@/pages/deviceManagement/sparePartsWarehousing'),
    meta: { title: 'menu.deviceManagement.sparePartsModule.sparePartsWarehousing', keepAlive: true, permission: ['form'] }
  },
  //备品领用-add
  sparePartsUsed:{
    path: '/deviceManagement/sparePartsModule/sparePartsUsed',
    name: 'sparePartsUsed',
    component: () => import('@/pages/deviceManagement/sparePartsUsed'),
    meta: { title: 'menu.deviceManagement.sparePartsModule.sparePartsUsed', keepAlive: true, permission: ['form'] }
  },
  // 设备组
  deviceGroup: {
    path: '/deviceManagement/deviceGroup',
    name: 'deviceGroup',
    icon: "schedule",
    component: () => import('@/pages/deviceManagement/deviceGroup'),
    meta: { title: 'menu.deviceManagement.deviceGroup', keepAlive: true, permission: ['form'] }
  },
  // 设备保养
  deviceMaintenance:{
    path: '/deviceMaintenance',
    name: 'deviceMaintenance',
    component: RouteView,
    meta: { title: 'menu.deviceMaintenance', icon: 'table', permission: ['form'] },
  },
  // 保养计划
  maintenancePlan: {
    path: '/deviceMaintenance/maintenancePlan',
    name: 'maintenancePlan',
    icon: "schedule",
    component: () => import('@/pages/deviceMaintenance/maintenancePlan.vue'),
    meta: { title: 'menu.deviceMaintenance.maintenancePlan', keepAlive: true, permission: ['form'] }
  },
  // 保养任务
  maintenanceTask: {
    path: '/deviceMaintenance/maintenanceTask',
    name: 'maintenanceTask',
    icon: "schedule",
    component: () => import('@/pages/deviceMaintenance/maintenanceTask.vue'),
    meta: { title: 'menu.deviceMaintenance.maintenanceTask', keepAlive: true, permission: ['form'] }
  },
  // 设备保养
  maintenance: {
    path: '/deviceMaintenance/maintenance',
    name: 'maintenance',
    icon: "schedule",
    component: () => import('@/pages/deviceMaintenance/maintenance.vue'),
    meta: { title: 'menu.deviceMaintenance.maintenance', keepAlive: true, permission: ['form'] }
  },
  // 设备维修
  deviceRepair:{
    path: '/deviceRepair',
    name: 'deviceRepair',
    component: RouteView,
    meta: { title: 'menu.deviceRepair', icon: 'table', permission: ['form'] },
  },
  // 维修单
  repairOrder: {
    path: '/deviceRepair/repairOrder',
    name: 'repairOrder',
    icon: "schedule",
    component: () => import('@/pages/deviceRepair/repairOrder'),
    meta: { title: 'menu.deviceRepair.repairOrder', keepAlive: true, permission: ['form'] }
  },
  // 维修
  repair: {
    path: '/deviceRepair/repair',
    name: 'repair',
    icon: "schedule",
    component: () => import('@/pages/deviceRepair/repair'),
    meta: { title: 'menu.deviceRepair.repair', keepAlive: true, permission: ['form'] }
  },
  // 设备点检
  deviceSpotCheck:{
    path: '/deviceSpotCheck',
    name: 'deviceSpotCheck',
    component: RouteView,
    meta: { title: 'menu.deviceSpotCheck', icon: 'table', permission: ['form'] },
  },
  // 点检计划
  spotCheckPlan: {
    path: '/deviceSpotCheck/spotCheckPlan',
    name: 'spotCheckPlan',
    icon: "schedule",
    component: () => import('@/pages/deviceSpotCheck/spotCheckPlan'),
    meta: { title: 'menu.deviceSpotCheck.spotCheckPlan', keepAlive: true, permission: ['form'] }
  },
  // 点检
  spotCheck: {
    path: '/deviceSpotCheck/spotCheck',
    name: 'spotCheck',
    icon: "schedule",
    invisible: false,
    component: () => import('@/pages/deviceSpotCheck/spotCheck'),
    meta: { title: 'menu.deviceSpotCheck.spotCheck', keepAlive: true, permission: ['form'] }
  },
  // 报表查询
  reportQuery:{
    path: '/reportQuery',
    name: 'reportQuery',
    component: RouteView,
    meta: { title: 'menu.reportQuery', icon: 'table', permission: ['form'] },
  },
  // 保养状况分析
  maintenanceAnalysis: {
    path: '/reportQuery/maintenanceAnalysis',
    name: 'maintenanceAnalysis',
    icon: "schedule",
    component: () => import('@/pages/reportQuery/maintenanceAnalysis'),
    meta: { title: 'menu.reportQuery.maintenanceAnalysis', keepAlive: true, permission: ['form'] }
  },
  // 保养完成情况
  maintenanceCompletion: {
    path: '/reportQuery/maintenanceCompletion',
    name: 'maintenanceCompletion',
    icon: "schedule",
    component: () => import('@/pages/reportQuery/maintenanceCompletion'),
    meta: { title: 'menu.reportQuery.maintenanceCompletion', keepAlive: true, permission: ['form'] }
  },
  // 点检状况分析
  spotCheckAnalysis: {
    path: '/reportQuery/spotCheckAnalysis',
    name: 'spotCheckAnalysis',
    icon: "schedule",
    component: () => import('@/pages/reportQuery/spotCheckAnalysis'),
    meta: { title: 'menu.reportQuery.spotCheckAnalysis', keepAlive: true, permission: ['form'] }
  },
  // 点检完成情况
  spotCheckCompletion: {
    path: '/reportQuery/spotCheckCompletion',
    name: 'spotCheckCompletion',
    icon: "schedule",
    component: () => import('@/pages/reportQuery/spotCheckCompletion'),
    meta: { title: 'menu.reportQuery.spotCheckCompletion', keepAlive: true, permission: ['form'] }
  },
  // 设备维修情况
  deviceRepairCompletion: {
    path: '/reportQuery/deviceRepairCompletion',
    name: 'deviceRepairCompletion',
    icon: "schedule",
    component: () => import('@/pages/reportQuery/deviceRepairCompletion'),
    meta: { title: 'menu.reportQuery.deviceRepairCompletion', keepAlive: true, permission: ['form'] }
  },
  // 基础资料
  basicInfo:{
    path: '/basicInfo',
    name: 'basicInfo',
    component: RouteView,
    meta: { title: 'menu.basicInfo', icon: 'table', permission: ['form'] },
  },
  // 设备类别
  deviceCategory: {
    path: '/basicInfo/deviceCategory',
    name: 'deviceCategory',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/deviceCategory'),
    meta: { title: 'menu.basicInfo.deviceCategory', keepAlive: true, permission: ['form'] }
  },
  // 设备等级
  deviceGrade: {
    path: '/basicInfo/deviceGrade',
    name: 'deviceGrade',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/deviceGrade'),
    meta: { title: 'menu.basicInfo.deviceGrade', keepAlive: true, permission: ['form'] }
  },
  // 备品类别
  sparePartsCategory: {
    path: '/basicInfo/sparePartsCategory',
    name: 'sparePartsCategory',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/sparePartsCategory'),
    meta: { title: 'menu.basicInfo.sparePartsCategory', keepAlive: true, permission: ['form'] }
  },
  // 保养类别
  maintenanceCategory: {
    path: '/basicInfo/maintenanceCategory',
    name: 'maintenanceCategory',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/maintenanceCategory'),
    meta: { title: 'menu.basicInfo.maintenanceCategory', keepAlive: true, permission: ['form'] }
  },
  // 保养项目
  maintenanceProject: {
    path: '/basicInfo/maintenanceProject',
    name: 'maintenanceProject',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/maintenanceProject'),
    meta: { title: 'menu.basicInfo.maintenanceProject', keepAlive: true, permission: ['form'] }
  },
  // 故障原因
  failureCause: {
    path: '/basicInfo/failureCause',
    name: 'failureCause',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/failureCause'),
    meta: { title: 'menu.basicInfo.failureCause', keepAlive: true, permission: ['form'] }
  },
  // 点检项目
  spotCheckProject: {
    path: '/basicInfo/spotCheckProject',
    name: 'spotCheckProject',
    icon: "schedule",
    component: () => import('@/pages/basicInfo/spotCheckProject'),
    meta: { title: 'menu.basicInfo.spotCheckProject', keepAlive: true, permission: ['form'] }
  },
  // 系统管理
  systemManagement:{
    path: '/systemManagement',
    name: 'systemManagement',
    component: RouteView,
    meta: { title: 'menu.systemManagement', icon: 'table', permission: ['form'] },
  },
  // 系统设置
  systemSetting: {
    path: '/systemManagement/systemSetting',
    name: 'systemSetting',
    icon: "schedule",
    component: () => import('@/pages/systemManagement/systemSetting'),
    meta: { title: 'menu.systemManagement.systemSetting', keepAlive: true, permission: ['form'] }
  },
  // 权限管理
  authorityManagement: {
    path: '/systemManagement/authorityManagement',
    name: 'authorityManagement',
    icon: "schedule",
    invisible: false,
    component: () => import('@/pages/systemManagement/authorityManagement'),
    meta: { title: 'menu.systemManagement.authorityManagement', keepAlive: true, permission: ['form'] }
  },
}
export default routerMap;

